import request from '/@/utils/request';

/**
 * 角色操作接口
 */
export function useDictApi() {
	return {
		getAllDictTypeList: (params?: object) => {
			return request<any, AjaxResult>({
				url: '/dictType/AllDictList',
				method: 'get',
				params,
			});
		},
		getDictTypeList: (data={}) => {
			return request<any, AjaxResult>({
				url: '/dictType/PageList',
				method: 'post',
				data,
			});
		},
		getTypeList: (params?:object) => {
			return request<any, AjaxResult>({
				url: '/dictType/List',
				method: 'get',
				params,
			});
		},
		getAllDictType: (params?: object) => {
			return request<any, AjaxResult>({
				url: '/dictType/allDictList',
				method: 'get',
				params,
			});
		},
		addDictType: (data={}) => {
			return request<any, AjaxResult>({
				url: '/dictType/Add',
				method: 'post',
				data,
			});
		},
		editDictType: (data={}) => {
			return request<any, AjaxResult>({
				url: '/dictType/Update',
				method: 'post',
				data,
			});
		},
		getDictDataList: (data={}) => {
			return request<any, AjaxResult>({
				url: '/dictData/PageList',
				method: 'post',
				data,
			});
		},
		addDictData: (data={}) => {
			return request<any, AjaxResult>({
				url: '/dictData/Add',
				method: 'post',
				data,
			});
		},
		editDictData: (data={}) => {
			return request<any, AjaxResult>({
				url: '/dictData/Update',
				method: 'post',
				data,
			});
		},
		getDataList: (code:string) => {
			return request<any, AjaxResult>({
				url: '/dictType/DataList?code='+code,
				method: 'get',
				//params,
			});
		},
	};
}
